package com.panopset;

/**
 * Useful String values.
 *
 * @author Karl Dinwiddie
 *
 */
public final class Strings {

    /**
     * End of line.
     */
    private static String eol;

    /**
     * Defaults to Carriage Return and Line Feed.
     *
     * @return Default value or value set by setEol.
     */
    public static String getEol() {
        if (eol == null) {
            eol = DOS_RTN;
        }
        return eol;
    }

    /**
     * Rarely used.
     *
     * @param value New end of line, or line feed value.
     */
    public static void setEol(final String value) {
        eol = value;
    }


    /**
     * UTF8.
     */
    public static final String UTF_8 = "UTF8";

    /**
     * Java system property <b>file.separator</b>.
     */
    public static final String PATH_SEP = System.getProperty("file.separator");

    /**
     * Java system property <b>user.dir</b>.
     */
    public static final String USER_DIR = System.getProperty("user.dir");

    /**
     * Line feed value.
     */
    public static final int LINE_FEED_VALUE = 10;

    /**
     * (char) 10 or 0xA.
     */
    public static final String LINE_FEED = "" + (char) LINE_FEED_VALUE;

    /**
     * Line feed value.
     */
    public static final int CARRIAGE_RETURN_VALUE = 13;

    /**
     * Decimal 13 or 0xC.
     */
    public static final String CARRIAGE_RETURN = ""
            + (char) CARRIAGE_RETURN_VALUE;

    /**
     * 0x0C0A.
     */
    public static final String DOS_RTN = CARRIAGE_RETURN + LINE_FEED;

    /**
     * Java system property <b>line.separator</b>.
     */
    public static final String RTN = System.getProperty("line.separator");

    /**
     * Java system property <b>user.home</b>.
     */
    public static final String USER_HOME = System.getProperty("user.home");

    /**
     * Panopset user directory <b>.com.panopset</b>.
     */
    public static final String PANSOPSET_USER_DIR = USER_HOME + PATH_SEP
            + ".com.panopset";

    /**
     * Tab character.
     */
    public static final String TAB = "" + '\u0009';

    /**
     * <b>.xml</b>.
     */
    public static final String XML_SFX = ".xml";

    /**
     * Java return character.
     */
    public static final String JAVA_RTN = "\n";

    /**
     * Copyright character.
     */
    public static final String COPYRIGHT = "\u00a9";

    /**
     * Prevent instantiation.
     */
    private Strings() { }
}
